package cc.ailley.observer.subject;

import java.util.ArrayList;

public abstract class ISubject<Observer, Event> {

    ArrayList<Observer> observers = new ArrayList<>();

    public void attach(Observer observer){
        observers.add(observer);
    }

    public void detach(Observer observer){
        observers.remove(observer);
    }

    public abstract void notify(Event event);
}
